<?php
// +----------------------------------------------------------------------
// | 会员模块
// +----------------------------------------------------------------------
// | Author: myh
// +----------------------------------------------------------------------
namespace app\admin\service;

use app\common\model\UserModel;
use app\common\lib\phpspreadsheet\Excel;

class AuserService{
    /**
     * 导出
     */
    public static function export($param){
        $keyArr = array_keys($param);
        $list = UserModel::with('userLevel')->withSearch($keyArr, $param)->withoutField('password')->select()->toArray();
        $head = '编号,账号,昵称,手机,等级,性别,积分,成长值,注册时间';
        $fields = 'user_sn,account,nickname,mobile,level_name,sex,user_integral,user_growth,create_time';
        Excel::export($list, $head, $fields);
    }
}